<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
  	<link rel="stylesheet" type="text/css" href="${verDetalhesLivroBean.linkCssLayoutPagina}" />
  	<link href="CSS/styles.css" rel="stylesheet" type="text/css" />
  	<link href="CSS/posicaoDoMenu.css" rel="stylesheet" type="text/css" />
  	<script src="javascript/paraOMiniForum.js"></script>
  	
  	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Fórum</title>
	
	
	
</h:head>

<h:body>

<f:metadata>
        <f:event type="preRenderView" listener="#{verDetalhesLivroBean.carregarCSSLayoutParaQualquerPagina}"/>
</f:metadata>
<f:view>
	
	
	<!-- vamos primeiro definir o menu que ficará no canto esquerdo da página -->
  <div id='cssmenu'>
        <ul>
            <li class='active '><a href='index.xhtml'><span>Home</span></a></li>
            <li><h:form><h:commandLink action="#{listarPersonagensDoLivroBean.listarPersonagensLivro}"><span>Personagens</span></h:commandLink></h:form></li>
            <li><h:form><h:commandLink action ="#{verTodosOsPontosPositivosDoLivro.pegarTodosOsPontosPositivosDoLivro}"><span>Pontos positivos do livro</span></h:commandLink></h:form></li>
            <li><h:form><h:commandLink action = "#{verResenhasBean.pegarTitulosNotasDeTodasAsResenhas}"><span>Resenhas</span></h:commandLink></h:form></li>
            <li><h:form><h:commandLink action="#{verForumBean.verTopicosDoForum}"><span>Fórum</span></h:commandLink></h:form></li>
            <li><a href='paginaDeAutenticacao.xhtml'><span>Editar Site</span></a></li>
        </ul>
  </div>
  <!-- agora, vamos descrever o resto do site que não é menu. E vamos separá-los em um div  
        gigante-->
  <div id='conteudoPagina'>
  	<p:messages />   
    
    <table cellspacing="30">
    <tr>
    <td>
    	<h1 id='tituloPergunta'> F&oacute;rum </h1>
    </td>
    </tr>
    <c:forEach var="entry" items="${verForumBean.titulosEDescricoesDeTopicosDeForum}">
    <tr>
    <td width = "600px">
		<h:form>
    	<h:commandLink class="linkTituloTopico" action="#{visualizarTopicoDeForumBean.visualizarTopicoDeForum}">
    		<f:param name="tituloTopico" value ="${entry.key}"></f:param>  
    		<h1 class="tituloTopicoForum">${entry.key}</h1>
    	</h:commandLink>
    		<h3 class="descricaoTopicoForum">${entry.value}</h3><br />
    	</h:form>
    </td>
    </tr>	
    </c:forEach>
   </table>
   <button style="position:fixed;bottom:3%;right: 83%;font-size: 24px;font-family:Showcard Gothic;" onclick="parent.location='criarTopico.xhtml'">Criar tópico</button> 
  </div>
  </f:view>
  </h:body>
</html>